<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<script rel="script" src="<%=basePath%>js/vue.min.js"></script>  

  
<div class="sousuo">
	<h1 style="margin-left: -500px">耶优品</h1>
	<div class="sousuo1">
		<input type="text" id="search"> <a id="asearch" href="">
			<img onclick="return search()"
			src="static/images/sousuo.png" alt=""> </a> 
			<a href="order" id="ordercar"> 
			<img src="static/images/car.png" alt=""  style="margin-left: 30px"></a>
		<span id="shopcarcount" style="border-radius: 50%;    height: 20px;    width: 20px;    display: inline-block;    background: red;      vertical-align: top;">
      		<span style="display: block;    color: #FFFFFF;    height: 20px;    line-height: 20px;    text-align: center">{{shopcarcount}}</span>
 		</span>
	</div>
</div>


<script>
	var shopcar=new Vue({
		el:"#shopcarcount",
		data:{
			shopcarcount:"0",
		}	
	})
		
	var phone=${user.phone}+"";
	if(phone!=""&&phone!=null){
		$.post("shopcar",function(data){
			if(data!=(-1)){
				shopcar.shopcarcount=data;
			}else{
				$("#shopcarcount").remove();
				$("#ordercar").attr("href","javascript:return false;");
			}
		},"json");
	}else{
		$("#shopcarcount").remove();
		$("#ordercar").attr("href","javascript:return false;");
	};

</script>